fix(code-review): make the documented "." catch-all actually match - #1
Merged
Conversation
diff_paths are matched with startswith(), so the README's catch-all example — diff_paths ["."] plus exclude_paths — only ever matched dotfile paths. A repo whose PR touched just README.md, package.json or Scarb.toml got no review at all, silently. The failure is easy to miss because the pathspec half of the same value is correct: `git diff -- . ':!packages/'` scopes exactly right, so the agent reviews the right files on the runs where it does trigger. Normalizes "." / "./" / "" to the empty prefix in the matcher (every path startswith ""), and maps "" back to "." when building the git pathspec, since "" is not a valid pathspec. Also documents that these are literal prefixes, not globs — "src/**" matches nothing today and gives no warning. Verified no behavior change for existing callers: the patched and original matchers produce identical output for denshokan-sdk's and game-components' configs across 10 changed-file sets each. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
starknetdev
added a commit
to Provable-Games/game-components
that referenced
this pull request
Jul 29, 2026
Both depend on shared-workflow changes that have now landed at v1. review-agents.json: the general agent goes back to the documented diff_paths ["."] + exclude_paths ["packages/"]. The enumerated top-level list was a workaround for the prefix matcher treating "." as a dotfile prefix (fixed in Provable-Games/.github#1), and it silently missed any new root file — LICENSE and docs/** matched no agent at all. pr-ci.yml: block_on_severity: true restores the merge gate the inline review jobs had (Provable-Games/.github#2). Without it a [CRITICAL] finding would only post a comment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
starknetdev
added a commit
to Provable-Games/game-components
that referenced
this pull request
Jul 29, 2026
* chore(ci): delegate AI review to the org-shared reusable workflow Replaces four hand-rolled review jobs (claude/codex x packages/general) with a single call to Provable-Games/.github code-review.yml@v1. Review logic, prompt assembly, comment upserting and model config now live in one place, so a model deprecation is an org-variable change rather than an edit here. This repo supplies only .github/review-agents.json plus the existing .github/prompts/*.md. Net -577 lines. Also drops the local AI-availability gate: the shared workflow owns fork skipping, so the `changes` job no longer computes can_run_ai_reviews and the pr-ci aggregate is back to a plain did-any-job-fail check. The general agent enumerates top-level paths rather than using the documented ["."] catch-all: the shared workflow's matcher is prefix based, so ["."] only matches dotfiles and would silently skip review on README.md / Scarb.toml / codecov.yml-only PRs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore(ci): use the documented catch-all and restore the severity gate Both depend on shared-workflow changes that have now landed at v1. review-agents.json: the general agent goes back to the documented diff_paths ["."] + exclude_paths ["packages/"]. The enumerated top-level list was a workaround for the prefix matcher treating "." as a dotfile prefix (fixed in Provable-Games/.github#1), and it silently missed any new root file — LICENSE and docs/** matched no agent at all. pr-ci.yml: block_on_severity: true restores the merge gate the inline review jobs had (Provable-Games/.github#2). Without it a [CRITICAL] finding would only post a comment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(ci): record why the review job pins @v1 and inherits secrets Both were flagged as reproducibility/least-privilege risks in review. Keeping them, deliberately: @v1 is the org convention every caller uses and is what makes an upstream model change a one-place fix, and the callee is first-party and declares exactly the two secrets it uses. Pinning a SHA or enumerating secrets here would diverge from the other six callers for no practical gain. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The README's catch-all example does not work.
diff_pathsare matched withstartswith(), so"."matches only paths that literally begin with a dot:A repo following the documented pattern gets no review at all on a PR that touches only
README.md,package.json,Scarb.toml,codecov.yml— anything not under a dotted path. It fails silently: no error, no skipped job, the agent simply never enters the matrix.It is also easy to miss in review, because the pathspec half of the same value is correct.
git diff -- . ':!packages/'scopes exactly right, so on the runs where the agent does trigger (a.github/**change, say) it reviews the right files. Only the trigger decision is wrong.Found while porting
game-componentsto this workflow (Provable-Games/game-components#122), which had to enumerate every top-level path as a workaround.The fix
"."/"./"/""to the empty prefix in the matcher. Every path starts with"", so a catch-all matches everything, andexclude_pathsstill carves out the app dirs.""back to"."when buildingdiff_paths_str, since""is not a valid git pathspec but"."is and means the same thing. So[""]and["."]now behave identically on both halves."src/**"matches nothing today and gives no warning — worth stating outright.Verification
No behavior change for existing callers. I extracted the matcher from the workflow before and after, and ran both against the two live configs —
denshokan-sdkandgame-components— across 10 changed-file sets each:The catch-all now works. With
diff_paths: ["."],exclude_paths: ["packages/"]:README.mdgeneralScarb.tomlgeneralcodecov.ymlgeneral.github/workflows/x.ymlgeneralpackages/a/b.cairopackagespackages/a/b.cairo+README.mdpackages,generalEmitted pathspec is valid for both spellings:
git diff -- . :!packages/.Edge cases: an empty
agentsarray returns{"include":[]}rather than erroring, and"src/**"still matches nothing — now called out in the README instead of silently surprising the next person.npx yaml@2.8.1 validpasses on the workflow.Consumer impact (all 6 live callers audited)
gh search code 'code-review.yml@v1' --owner Provable-Gamesfinds six consumers. I ran the pre- and post-patch matchers against every one of their real configs across 12 changed-file sets:"."catch-alldenshokan-sdkbudokan-sdkon-ramp-sdkmetagame-sdkbudokanmetagame_extensionsOnly entries that are exactly
".","./"or""change meaning, so a config without one is bit-identical by construction.budokanandmetagame_extensionsare the two repos the bug is currently biting. Theirgeneralagent almost never runs today — aREADME.md,package.json,docs/**orLICENSEPR matches nothing at all:That is the fix landing, not a regression — those PRs are going unreviewed right now. But it is a live behavior change on two active repos, so it should be a conscious merge rather than a surprise.
It cannot turn a green build red. The only
exit 1paths in this workflow are a missing config file and a non-zero exit from the codex CLI itself; findings are never gated on severity. Both repos call this from a standalonepr-review.ymlwith no aggregate job depending onreview, so nothing gates a merge on it either. The blast radius is more review jobs, more PR comments, and more spend on those two repos.After merge
This is backward-compatible (0 diffs above), so per the README's versioning note the
v1tag should move forward to pick it up — callers pin@v1. I have not moved the tag.Once it does,
game-componentscan drop its enumerated path list back to the documented two-line catch-all.🤖 Generated with Claude Code